import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class App {
    public static void main(String[] args) throws Exception {
        System.out.println("Welcome to Alimama");
        Inventory myInv = new Inventory(); // 如果有数据库 就读取数据库
        Scanner myObj = new Scanner(System.in);
        System.out.println("Are you a buyer or a seller");
        String bors = myObj.nextLine();
        // System.out.println("Your are " + bors);
        System.out.println("Choose your category?\n1. Commodity (C)\n2. Electronic (E)\n3. Food (F)");
        String opt = myObj.nextLine().toUpperCase();
        List<Product> productList = myInv.findProdList(opt);
        myInv.showOptProduct(opt); //根据user选择的类，display所有的商品

        System.out.println("Please choose your item");
        String item_name = myObj.nextLine();
        System.out.println("The number of " + item_name + ": ");
        int item_num = myObj.nextInt();
        if (myInv.checkValid_item_num(item_name, item_num)) {
            System.out.println("succeed");
        } else {
            System.out.println("fail");
        }
    }

}